﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using SES.CMS.DO;
using SES.CMS.BL;

namespace SES.CMS
{
    public partial class QuyHoach : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                MasterPage mt = this.Master as MasterPage;
                Control uc = mt.FindControl("ucHomeSlide1") as Control;
                uc.Visible = false;
                if (Request.QueryString["ID"] != null)
                {
                    int ID = int.Parse(Request.QueryString["ID"]);
                    string Title = new cmsCategoryBL().Select(new cmsCategoryDO { CategoryID = ID }).Title;
                    Page.Title = Title + " - " + Ultility.PageTitle();
                    HtmlMeta metaDesc = new HtmlMeta();
                    metaDesc.Name = "description";
                    metaDesc.Content = Title + " - " + new sysConfigBL().Select(new sysConfigDO { ConfigID = 1 }).ConfigValue;
                    Page.Header.Controls.Add(metaDesc);
                    Page.Header.Controls.Add(metaDesc);
                }
                else
                {
                    Page.Title = Ultility.PageTitle();
                    HtmlMeta metaDesc = new HtmlMeta();
                    metaDesc.Name = "description";
                    metaDesc.Content = new sysConfigBL().Select(new sysConfigDO { ConfigID = 1 }).ConfigValue;
                    Page.Header.Controls.Add(metaDesc);
                }
            }
        }

        public string FriendlyUrl2(string s)
        {
            return Ultility.Change_AV2(s);
        }

        public string CategoryTitle(string CategoryID)
        {
            string CategoryTitle = "";
            CategoryTitle = FriendlyUrl2(new cmsCategoryBL().Select(new cmsCategoryDO { CategoryID = int.Parse(CategoryID) }).Title);
            return CategoryTitle;
        }
    }
}